//
//  FeedBackViewController.m
//  Lmm_IOS
//
//  Created by 张哲炜 on 2018/9/29.
//  Copyright © 2018年 lmm. All rights reserved.
//

#import "FeedBackViewController.h"

@interface FeedBackViewController ()

@end

@implementation FeedBackViewController{
    UIView *navView;
    
    
}

- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = UIColorFromRGB(0xEEEEEE);
    
    self->navView = UIView.new;
    self->navView.backgroundColor = [UIColor whiteColor];
    
    int height = NAVIGATION_BAR_HEIGHT;
    int titleLabelOffset = 20;
    if (DEVICE_IS_IPHONEX) {
        height = NAVIGATION_BAR_X_HEIGHT;
        titleLabelOffset = 40;
    }
    
    [self.view addSubview:navView];
    
    [navView makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.view.top).offset(0);
        make.left.equalTo(self.view.left).offset(0);
        make.right.equalTo(self.view.right).offset(0);
        make.height.equalTo(height);
    }];
    
    
    UIView *divideLine = UIView.new;
    divideLine.backgroundColor =UIColorFromRGB(0xCCCCCC) ;
    [navView addSubview:divideLine];
    
    [divideLine makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self->navView.bottom);
        make.left.equalTo(self.view.left).offset(0);
        make.right.equalTo(self.view.right).offset(0);
        make.height.equalTo(1/[[UIScreen mainScreen] scale]);
    }];
    
    
    UIImageView *backImage = UIImageView.new;
    backImage.image = [UIImage imageNamed:@"back"];
    [navView addSubview:backImage];
    
    [backImage makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->navView.left).offset(15);
        make.top.equalTo(self->navView.top).offset(height-30);
        make.width.equalTo(10);
        make.height.equalTo(18);
    }];
    
    
    
    UIButton *backbtn = UIButton.new;
    [backbtn addTarget:self action:@selector(btnClick) forControlEvents:UIControlEventTouchUpInside];
    [navView addSubview:backbtn];
    
    [backbtn makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self->navView.left).offset(10);
        make.top.equalTo(self->navView.top).offset(20);
        make.width.equalTo(50);
        make.height.equalTo(40);
    }];
    
    
    UILabel *title = UILabel.new;
    title.textColor = [UIColor blackColor];
    title.font = [UIFont systemFontOfSize:20];
    title.text = @"意见反馈";
    [navView addSubview:title];
    
    [title makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self->navView.centerX);
        make.centerY.equalTo(backImage.centerY);
    }];
    
    
    UIButton *button = UIButton.new;
    [button setTitle:@"提交" forState:UIControlStateNormal];
    [button setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
    button.titleLabel.font = [UIFont systemFontOfSize:16];
    [button addTarget:self action:@selector(sendEvent) forControlEvents:UIControlEventTouchUpInside];
    [navView addSubview:button];
    
    [button makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self->navView.right).offset(-15);
        make.centerY.equalTo(title.centerY);
        make.width.equalTo(40);
        make.height.equalTo(40);
    }];
    
    
    UILabel *contentLabel =UILabel.new;
    contentLabel.text = @"反馈内容 : ";
    contentLabel.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:contentLabel];
    
    [contentLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.left).offset(15);
        make.top.equalTo(self->navView.bottom).offset(10);
        make.height.equalTo(30);
        make.width.equalTo(100);
    }];
    
    
    UITextField *contentTextField = UITextField.new;
    contentTextField = UITextField.new;
    contentTextField.backgroundColor =[UIColor whiteColor];
    contentTextField.font = [UIFont systemFontOfSize:15];
    contentTextField.textColor = UIColorFromRGB(0xD0D0D0);
    contentTextField.clearButtonMode = UITextFieldViewModeAlways;
    contentTextField.placeholder = @"请输入您的问题或意见";
    //contentTextField.keyboardType = UIKeyboardTypePhonePad;
    contentTextField.borderStyle = UITextBorderStyleNone;
    [self.view addSubview:contentTextField];

    [contentTextField makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(contentLabel.bottom).offset(7);
        make.left.equalTo(self.view.left).offset(0);
        make.right.equalTo(self.view.right).offset(0);
        make.height.equalTo(200);

    }];


    UILabel *numberLabel =UILabel.new;
    numberLabel.text = @"联系方式 : ";
    numberLabel.font = [UIFont systemFontOfSize:15];
    [self.view addSubview:numberLabel];

    [numberLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.view.left).offset(15);
        make.top.equalTo(contentTextField.bottom).offset(10);
        make.height.equalTo(30);
        make.width.equalTo(100);
    }];


    UITextField *linkTextField = UITextField.new;
    linkTextField = UITextField.new;
    linkTextField.backgroundColor =[UIColor whiteColor];
    linkTextField.font = [UIFont systemFontOfSize:15];
    linkTextField.textColor = UIColorFromRGB(0xD0D0D0);
    linkTextField.clearButtonMode = UITextFieldViewModeAlways;
    linkTextField.placeholder = @"请输入您的问题或意见";
    //contentTextField.keyboardType = UIKeyboardTypePhonePad;
    linkTextField.borderStyle = UITextBorderStyleNone;
    [self.view addSubview:linkTextField];

    [linkTextField makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(numberLabel.bottom).offset(7);
        make.left.equalTo(self.view.left).offset(0);
        make.right.equalTo(self.view.right).offset(0);
        make.height.equalTo(40);

    }];

}


- (void) sendEvent {
    
    
    NSLog(@"1234");
    
}





-(void) btnClick {
    
      [self.navigationController popViewControllerAnimated:YES];
    
}


@end
